﻿
using System.Linq;

using Bootstrap5.Abstractions;

using Microsoft.AspNetCore.Components;

namespace Bootstrap5;

[CssClass("list-group")]
public class ListGroup: BootstrapChildContentWithCascadingValueComponentBase<ListGroup>
{
    [Parameter][CssClass("list-group-flush")] public bool Flush { get; set; }
    [Parameter] [CssClass("list-group-numbered")] public bool Numbered { get; set; }
    [Parameter] [CssClass("list-group-horizontal")] public bool Horizontal { get; set; }
    [Parameter] public BreakPoint[] HorizontalBreakPoints { get; set; }

    protected override void CreateCssClass(ICssClassBuilder builder)
    {
        if(HorizontalBreakPoints is not null)
        {
            builder.Add(HorizontalBreakPoints.Select(breakpoint => $"list-group-horizontal-{breakpoint.GetEnumCssClass()}"));
        }
    }
}
